package com.leetcode.merci.lc461;

/**
 * Created by bowen on 2017/7/23.
 */
public class Solution {
    public int hammingDistance(int x, int y) {
        int result =x^y;
        int num=0;
        for(int i=0;i<32;i++){
            if((result>>i &1)==1){
                num++;
            }
        }
        return num;
    }
}
